Conversation
There was a problem hiding this comment.
Code Review
This pull request updates Grafana dashboard configurations to filter out specific Kafka topics from Prometheus queries. It also configures a custom ObjectMapper for Redis caching in CacheConfig.java to support Java records and lists. A critical security issue was identified in CacheConfig.java, where using BasicPolymorphicTypeValidator with allowIfBaseType(Object.class) exposes the application to insecure deserialization and Remote Code Execution (RCE) vulnerabilities. It is recommended to restrict the allowed subtypes to specific packages or safe classes.
| BasicPolymorphicTypeValidator validator = BasicPolymorphicTypeValidator.builder() | ||
| .allowIfBaseType(Object.class) | ||
| .build(); |
There was a problem hiding this comment.
BasicPolymorphicTypeValidator를 설정할 때 allowIfBaseType(Object.class)를 사용하는 것은 Java의 모든 객체(Object를 상속받는 모든 클래스)의 역직렬화를 허용하게 됩니다.\n\n주석에는 "Object 하위 타입만 허용해 deserialization gadget 위험 차단"이라고 작성되어 있으나, 실제로는 거의 모든 클래스가 Object를 상속받기 때문에 **알려진 모든 Deserialization Gadget(예: 원격 코드 실행을 유발하는 취약한 클래스들)의 역직렬화가 허용되어 심각한 보안 취약점(RCE)**이 발생할 수 있습니다.\n\n따라서 Object.class 전체를 허용하는 대신, 캐싱 대상이 되는 안전한 패키지 경로(예: com.catchtable)나 특정 클래스들만 허용하도록 제한해야 합니다.
BasicPolymorphicTypeValidator validator = BasicPolymorphicTypeValidator.builder()\n .allowIfSubType("com.catchtable")\n .allowIfSubType(java.util.Collection.class)\n .allowIfSubType(java.util.Map.class)\n .build();
📢 기능 설명
필요시 실행결과 스크린샷 첨부
연결된 issue
연결된 issue를 자동을 닫기 위해 아래 {이슈넘버}를 입력해주세요.
close #{이슈넘버}
✅ 체크리스트